package com.cxy.services;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cxy.dao.ProjectDao;
import com.cxy.pojo.Project;

@Service
@Transactional
public class ProjectServices {
	@Resource
	private ProjectDao projectDao;
	
	@Transactional(readOnly=true)
	public List<Project> find(){
		return projectDao.findAll();
	}
	@Transactional(readOnly=true)
	public Project get(int id){
		return projectDao.findById(id);
	}
	public void saveOrUpdate(Project p){
		projectDao.saveOrUpdate(p);
	}
	public void del(int id){
		projectDao.del(id);
	}
}
